<template>
  <div>
    <div class="footerBanner">
      <div v-if="ad" class="ad" v-html="ad"></div>
      <!-- <img :src="imgSrc" alt="">   -->
    </div>
  </div>

</template>

<script type="text/ecmascript-6">
/* eslint-disable*/
import { Tabbar, TabbarItem, Group, Cell } from "vux";
import Bus from "@/common/js/bus.js";

import { raceShow } from "@/api/raceshow.js";
import { indexedDB } from "@/api/indexedDB.js";

export default {
  props: ["page"],
  data() {
    return {
      show: false,
      imgSrc: "",
      ad: "",
      tel: "",
      href: ""
    };
  },
  created() {
    var _this = this;
    Bus.$on("raceInfo", e => {
      //_this.$set(this, "raceInfo", e);
      //console.log(e);
      _this.ad = e.ad;
      _this.imgSrc = e.footer;
      _this.tel = "tel:" + e.tel;
      _this.href = e.homepage;
      //console.log(this.raceInfo);
      //_this.raceInfo=e
      //window.localStorage.getItem
      //_this.imgSrc = e.footer;
    });
    //console.warn(this.page)
    this.raceid = this.page.raceid;
    //let _this = this;

    // raceShow(`${window.host}race/show`, {
    //   raceid: this.raceid
    // }).then(response => {
    //   if (response.data.code == 200) {
    //     console.warn(response.data.data.footer);
    //     _this.ad = response.data.data.ad;
    //     _this.imgSrc = response.data.data.footer;
    //     _this.tel = "tel:" + response.data.data.tel;

    //     if (response.data.data.homepage === "//tsmls.ihuipao.com") {
    //       response.data.data.homepage = "//www.tsmls.cn/";
    //     }
    //     _this.href = response.data.data.homepage;
    //     let data = response.data.data;
    //   }
    // });
  },
  mounted() {
    // Bus.$on('close', data => {
    //   this.show = false
    // })
  },
  methods: {
    pay() {
      window.location.href =
        "//wechat.ihuipao.com/qrpay?openid=" +
        window.localStorage.getItem("openid");
    }
  },
  components: {
    Tabbar,
    TabbarItem,
    Group,
    Cell
  }
};
</script>


<style lang="less" rel="stylesheet/less">
#tabbar {
  .weui-tabbar {
    max-width: 850px;
    z-index: 99;
  }
}

.footerBanner {
  margin-bottom: 50px;
}

.footerBanner img {
  max-width: 850px;
  width: 100vw;
}

#tabbar .list {
  background: #f7f7fa;
  position: absolute;
  right: 0;
  width: 33.33%;
  text-align: center;
  bottom: 80px;
}

#tabbar .list li {
  padding: 10px;
}

#tabbar .list li a {
  color: #999;
}

#tabbar .list:after {
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 20px solid #f7f7fa;
  display: block;
  content: "";
  text-align: center;
  margin: 0 auto;
  position: absolute;
  left: 0;
  right: 0;
}

ul,
li {
  list-style: none;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}

.fade-enter, .fade-leave-to /* .fade-leave-active in below version 2.1.8 */
 {
  opacity: 0;
}
</style>
